package com.baizhi.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

public class CmfzArticle implements Serializable {
    private Integer articleId;

    private String articleName;

    private String articleImage;

    private String articleContent;

    private Integer guruId;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date articleDate;

    private CmfzGuru cmfzGuru;

    private static final long serialVersionUID = 1L;

    public CmfzArticle() {
    }

    public CmfzArticle(Integer articleId, String articleName, String articleImage, String articleContent, Integer guruId, Date articleDate) {
        this.articleId = articleId;
        this.articleName = articleName;
        this.articleImage = articleImage;
        this.articleContent = articleContent;
        this.guruId = guruId;
        this.articleDate = articleDate;
    }

    public Integer getArticleId() {
        return articleId;
    }

    public void setArticleId(Integer articleId) {
        this.articleId = articleId;
    }

    public String getArticleName() {
        return articleName;
    }

    public void setArticleName(String articleName) {
        this.articleName = articleName == null ? null : articleName.trim();
    }

    public String getArticleImage() {
        return articleImage;
    }

    public void setArticleImage(String articleImage) {
        this.articleImage = articleImage == null ? null : articleImage.trim();
    }

    public String getArticleContent() {
        return articleContent;
    }

    public void setArticleContent(String articleContent) {
        this.articleContent = articleContent == null ? null : articleContent.trim();
    }

    public Integer getGuruId() {
        return guruId;
    }

    public void setGuruId(Integer guruId) {
        this.guruId = guruId;
    }

    public Date getArticleDate() {
        return articleDate;
    }

    public void setArticleDate(Date articleDate) {
        this.articleDate = articleDate;
    }

    public CmfzGuru getCmfzGuru() {
        return cmfzGuru;
    }

    public void setCmfzGuru(CmfzGuru cmfzGuru) {
        this.cmfzGuru = cmfzGuru;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        CmfzArticle other = (CmfzArticle) that;
        return (this.getArticleId() == null ? other.getArticleId() == null : this.getArticleId().equals(other.getArticleId()))
            && (this.getArticleName() == null ? other.getArticleName() == null : this.getArticleName().equals(other.getArticleName()))
            && (this.getArticleImage() == null ? other.getArticleImage() == null : this.getArticleImage().equals(other.getArticleImage()))
            && (this.getArticleContent() == null ? other.getArticleContent() == null : this.getArticleContent().equals(other.getArticleContent()))
            && (this.getGuruId() == null ? other.getGuruId() == null : this.getGuruId().equals(other.getGuruId()))
            && (this.getArticleDate() == null ? other.getArticleDate() == null : this.getArticleDate().equals(other.getArticleDate()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getArticleId() == null) ? 0 : getArticleId().hashCode());
        result = prime * result + ((getArticleName() == null) ? 0 : getArticleName().hashCode());
        result = prime * result + ((getArticleImage() == null) ? 0 : getArticleImage().hashCode());
        result = prime * result + ((getArticleContent() == null) ? 0 : getArticleContent().hashCode());
        result = prime * result + ((getGuruId() == null) ? 0 : getGuruId().hashCode());
        result = prime * result + ((getArticleDate() == null) ? 0 : getArticleDate().hashCode());
        return result;
    }

    @Override
    public String toString() {
        return "CmfzArticle{" +
                "articleId=" + articleId +
                ", articleName='" + articleName + '\'' +
                ", articleImage='" + articleImage + '\'' +
                ", articleContent='" + articleContent + '\'' +
                ", guruId=" + guruId +
                ", articleDate=" + articleDate +
                ", cmfzGuru=" + cmfzGuru +
                '}';
    }
}